<extend name="_layout/main" />
<block name="content">
	<div class="page-content">
		<div class="page-breadcrumbs">
			<ul class="breadcrumb">
				<li>
					<i class="fa fa-home"></i>
					<a href="{:U('dashboard/index')}">系统首页</a>
				</li>
				<li >提现管理</li>
				<li class="active">提现列表</li>
			</ul>
		</div>
		
		<div class="page-body">
			<div class="row">
				<div class="col-lg-12 col-sm-12 col-xs-12">
					<div class="widget">
						<div class="widget-header bordered-left bordered-darkorange">
							<span class="widget-caption">搜索</span>
						</div>						
						<div class="widget-body bordered-left bordered-warning">
							<form class="form-inline" role="form">
								
								
								<div class="form-group">
									<input type="text" class="form-control" name="user" placeholder="会员账号/ID" value="{$Think.request.user}">
								</div>
								<div class="form-group">
									<input type="text" class="form-control" name="account" placeholder="支付宝账号/姓名" value="{$Think.request.account}">
								</div>
								
								<button type="submit" class="btn btn-default">搜索</button>
							</form>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12 col-md-12">
					<form action="" id="listForm">
						<table class="table table-bordered">
							<thead>
								<tr>
									<th class="text-center">
										<label>
											<input type="checkbox" checked="checked" class="colored-success select-all">
											<span class="text"></span>
										</label>
									</th>
									<th>会员</th>
									<th>提现金额</th>
									<th>提现账户</th>
									<th>开户人</th>
									<th>申请时间</th>
									<th>状态</th>
								</tr>
							</thead>
							<notempty name="result">
							<volist name="result" id="val">
								<tr>
									<td class="text-center">
										<label>
											<input type="checkbox" checked="checked" name="id[{$val.id}]" value="{$val.id}" class="colored-success select-item">
											<span class="text"></span>
										</label>

									</td>
									<td>{$val.nickname}【{$val.mobile}】</td>
									<td><big class="orange">￥{$val.amount}</big></td>
									<td>{$val.account}</td>
									<td>{$val.account_name}</td>
									<td>{$val.add_time|format_time}</td>
									<td>
										<switch name="val.status">
											<case value="1"><span class="btn btn-blue btn-xs white">已处理</span></case>
											<case value="0"><span class="btn btn-danger btn-xs white">等待处理</span></case>
											<case value="-1"><span class="btn btn-warning btn-xs white">无效</span></case>
											<default />
										</switch>
									</td>
									
								</tr>
							</volist>
							<else/>
							<tr>
								<td colspan="6" class="text-center">没有提现记录</td>
							</tr>
							</notempty>
							<tbody>
							</tbody>
						</table>
						<notempty name="result">
						<input type="hidden" name="status" id="status">
						<div class="row DTTTFooter">
							<div class="col-sm-6">
								<div class="dataTables_info" id="simpledatatable_info" role="status" aria-live="polite">
									<div class="buttons-preview">
										<a href="javascript:void(0);" class="btn btn-default shiny">导出所选数据</a>										
									</div>
								</div>
							</div>
							<div class="col-sm-6">
								<div class="dataTables_paginate paging_bootstrap" id="simpledatatable_paginate">
									{$page}
								</div>
							</div>
						</div>
						</notempty>
					</form>
				</div>
			</div>
		</div>
	</div>
</block>

<block name="footer">

	<script type="text/javascript">
		$("#status_list a").on("click", function() {
			var status = $(this).attr("data-status");
			$("#status").val(status);
			if ($("input.select-item:checked").length < 1) {
				tips("请选择要操作数据", "danger");
				return false;
			}
			bootbox.confirm("确定该操作？", function(result) {
				if (result) {
					var data = $("#listForm").serialize();
					$.post("{:U('withdraw/change_status')}", data, function(result) {
						if (result.status == 'success') {
							location.reload();
						} else {
							tips(result.message, 'danger');
						}
					}, "json");
				}
			});
		})
	</script>
</block>